import { GET_CHANNEL_LIST, GET_ARTICLE_LIST } from "../constants"

const initValue = {
  channels: [],
  articles: {},
  articleInfo: {},
}

export default function article(state = initValue, action) {
  switch (action.type) {
    case GET_CHANNEL_LIST:
      return {
        ...state,
        channels: action.payload,
      }
    case GET_ARTICLE_LIST:
      return {
        ...state,
        articles: action.payload,
      }
    default:
      return state
  }
}
